package com.ruoyi.user.service;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.ruoyi.common.support.Convert;
import com.ruoyi.user.domain.Warning;
import com.ruoyi.user.mapper.WarningMapper;

/**
 * 预警 服务层实现
 * 
 * @author ruoyi
 * @date 2018-12-23
 */
@Service
public class WarningServiceImpl implements IWarningService 
{
	@Autowired
	private WarningMapper warningMapper;

	/**
     * 查询预警信息
     * 
     * @param id 预警ID
     * @return 预警信息
     */
    @Override
	public Warning selectWarningById(Integer id)
	{
	    return warningMapper.selectWarningById(id);
	}
	
	/**
     * 查询预警列表
     * 
     * @param warning 预警信息
     * @return 预警集合
     */
	@Override
	public List<Warning> selectWarningList(Warning warning)
	{
	    return warningMapper.selectWarningList(warning);
	}
	
    /**
     * 新增预警
     * 
     * @param warning 预警信息
     * @return 结果
     */
	@Override
	public int insertWarning(Warning warning)
	{
	    return warningMapper.insertWarning(warning);
	}
	
	/**
     * 修改预警
     * 
     * @param warning 预警信息
     * @return 结果
     */
	@Override
	public int updateWarning(Warning warning)
	{
	    return warningMapper.updateWarning(warning);
	}

	/**
     * 删除预警对象
     * 
     * @param ids 需要删除的数据ID
     * @return 结果
     */
	@Override
	public int deleteWarningByIds(String ids)
	{
		return warningMapper.deleteWarningByIds(Convert.toStrArray(ids));
	}
	
}
